﻿Public Class frmThuVien

    Private Sub btnTool_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTool.Click
        ContextMenuStrip1.Show(btnTool, btnTool.ClientSize.Width - 280, btnTool.ClientSize.Height)
    End Sub

    Private Sub frmThuVien_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'Phan quyen de co the thay duoc chuc nang quan ly
        If frmDangNhap.QuyenHan = 1 Then
            QuanLyToolStripMenuItem.Visible = False
        End If
    End Sub

    Private Sub frmThuVien_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
        Me.Close()
        frmDangNhap.Show()
    End Sub

    Private Sub ĐôiMâtKhâuToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ĐôiMâtKhâuToolStripMenuItem.Click
        Dim f As New frmDoiMatKhau
        f.ShowDialog()
    End Sub

    Private Sub ĐăngXuâtToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ĐăngXuâtToolStripMenuItem.Click
        Me.Close()
    End Sub

    Private Sub XemThôngTinChiTiêtToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles XemThôngTinChiTiêtToolStripMenuItem.Click
        If frmDangNhap.QuyenHan = 2 Then
            Dim f As New frmChiTietDocGia
            f.ShowDialog()
        Else
            Dim f As New frmChiTietNhanVien
            f.ShowDialog()
        End If
    End Sub

    Private Sub XemThôngTinTheToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles XemThôngTinTheToolStripMenuItem.Click
        Dim f As New frmThongTinTheDocGia
        f.ShowDialog()
    End Sub

    Private Sub XemThôngTinTaiKhoanToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles XemThôngTinTaiKhoanToolStripMenuItem.Click
        Dim f As New frmThongTinTaiKhoan
        f.ShowDialog()
    End Sub

    Private Sub XemDanhSachPhiêuMươnPhiêuTraToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles XemDanhSachPhiêuMươnPhiêuTraToolStripMenuItem.Click

    End Sub

    Private Sub Button1_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGio.MouseHover
        ToolTip1.SetToolTip(btnGio, "Có " + frmDangNhap.dsSachTrongGio.Count.ToString + " sách trong giỏ")
    End Sub

    Private Sub btnGio_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGio.Click
        Dim f As New frmDanhSachDangMuon
        f.ShowDialog()
    End Sub

    Private Sub btnSach_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSach.Click
        Dim f As New frmQuanLySach
        f.ShowDialog()
    End Sub

    Private Sub btnKeSach_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnKeSach.Click
        Dim f As New frmQuanLySachTrongKe
        f.ShowDialog()
    End Sub

    Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem1.Click
        Dim f As New frmTraSach
        f.ShowDialog()
    End Sub
End Class